<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

    <script>


        // 返回一个对象 
        const fun1 = uname => ({ name: uname })
        fun1('dcj')

        // 可变参数
        const sum = (...arr) => {

        }

        // this
        // 箭头函数不会创建自己的this,只会从自己的作用域的上一层沿用this
        const thisLamda = () => {
            // window
            // 查找的是<script>的this
            console.log(this)
        }


        const objLamda = {
            name : 'dcj',
            drink: () => {
                // window
                // 是window的obj调用的
                console.log(this)
            }
        }
        window.objLamda.drink()


        
        const objInvokeRecursive = {
            sleep: function () {
                // obj
                console.log(this)

                const ff = () => {
                    // obj sleep方法里是有this的
                    console.log(this)
                }
                ff()
            }
        }


    </script>
</body>

</html>